package com.ymatou.promotion.api.testcase;

import java.util.Date;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.promotion.api.parameter.GetCouponBatchBean;
import com.ymatou.promotion.api.parameter.SearchConditionBean;
import com.ymatou.promotion.api.service.GetCouponBatchCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.CouponCallService;
import com.ymttest.database.sqlwapper.YmtCouponBatchWapper;

/**
 * 获取优惠券批次信息
 *
 * @author chenjiazhu
 */
@TestSuite
public class Ts_GetCouponBatch {
	private static GetCouponBatchBean getcouponbatchBean;
	private static GetCouponBatchCall getcouponbatchCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取优惠券批次信息");
	}

	@Before
	public void caseUp() {
		getcouponbatchBean = new GetCouponBatchBean();
		getcouponbatchCall = new GetCouponBatchCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getcouponbatchCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_001() {
		Logger.start(true, "获取全场优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerDefaultCoupon();

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_002() {
		Logger.start(true, "获取商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon();

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_003() {
		Logger.start(true, "获取洋码头PC端商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon("1");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_004() {
		Logger.start(true, "获取洋码头WAP端商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon("2");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_005() {
		Logger.start(true, "获取洋码头APP商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon("3");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_006() {
		Logger.start(true, "获取神器APP商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon("4");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_007() {
		Logger.start(true, "获取神器WAP商品优惠券批次信息");
		try {
			String batchCode = new CouponCallService()
					.createSellerProductCoupon("5");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_008() {
		Logger.start(false, "验证SellerId空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setSellerId(0);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_009() {
		Logger.start(false, "验证BatchCode空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setBatchCode(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_010() {
		Logger.start(false, "验证BatchPrefix空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setBatchPrefix(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_011() {
		Logger.start(false, "验证CouponName空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCouponName(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_012() {
		Logger.start(false, "验证ValidStart空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setValidStart(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_013() {
		Logger.start(false, "验证ValidEnd空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setValidEnd(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_014() {
		Logger.start(false, "验证CreateStart空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCreateStart(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_015() {
		Logger.start(false, "验证CreateEnd空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCreateEnd(null);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_016() {
		Logger.start(false, "验证PageSize空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.setPageSize(0);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_017() {
		Logger.start(false, "验证CurPage空时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.setCurPage(0);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_018() {
		Logger.start(false, "验证SellerId不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setSellerId(111);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_019() {
		Logger.start(false, "验证BatchCode不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setBatchCode("111");

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_020() {
		Logger.start(false, "验证BatchPrefix不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setBatchPrefix("111");

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_021() {
		Logger.start(false, "验证CouponName不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCouponName("111");

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_022() {
		Logger.start(false, "验证ValidStart不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setValidStart(new Date());

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_023() {
		Logger.start(false, "验证ValidEnd不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setValidEnd(new Date());
			;

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_024() {
		Logger.start(false, "验证CreateStart不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCreateStart(new Date());
			;

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_025() {
		Logger.start(false, "验证CreateEnd不匹配时报错");
		try {
			Map item = setGetCouponBatchBean();
			getcouponbatchBean.getSearchCondition().setCreateEnd(new Date());
			;

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			Logger.verifyEquals("201", getcouponbatchCall.getCode(), "验证返回code");
			Logger.verifyEquals("-1", getcouponbatchCall.getBCode(),
					"验证返回Bcode");
			Logger.verifyEquals("-1:未查询到批次信息", getcouponbatchCall.getMsg(),
					"验证返回Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_026() {
		Logger.start(true, "获取洋码头PC端平台优惠券批次信息");
		try {
			String batchCode = new CouponCallService().createSellerCoupon("1");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_027() {
		Logger.start(true, "获取洋码头WAP端平台优惠券批次信息");
		try {
			String batchCode = new CouponCallService().createSellerCoupon("2");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_028() {
		Logger.start(true, "获取洋码头APP平台优惠券批次信息");
		try {
			String batchCode = new CouponCallService().createSellerCoupon("3");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_029() {
		Logger.start(true, "获取神器APP平台优惠券批次信息");
		try {
			String batchCode = new CouponCallService().createSellerCoupon("4");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCouponBatch_030() {
		Logger.start(true, "获取神器WAP平台优惠券批次信息");
		try {
			String batchCode = new CouponCallService().createSellerCoupon("5");

			Map item = setGetCouponBatchBean(batchCode);

			getcouponbatchCall.setData(getcouponbatchBean);
			getcouponbatchCall.callService();

			VerifyReturn(item);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	/**
	 * 根据batchcode获取表Ymt_CouponBatch中记录，根据记录中的值设置请求bean
	 * 
	 * @param batchCode
	 * @return
	 */
	private Map setGetCouponBatchBean(String batchCode) {
		Logger.comment("根据batchcode获取表Ymt_CouponBatch中记录，根据记录中的值设置请求bean");

		Map item = new YmtCouponBatchWapper().getCouponBatchByBatchCode(
				batchCode).get(0);

		SearchConditionBean searchConditionBean = new SearchConditionBean();

		searchConditionBean.setSellerId(Integer.parseInt(item
				.get("iOperatorId").toString()));
		searchConditionBean.setBatchCode(item.get("sBatchCode").toString());
		searchConditionBean.setBatchPrefix(item.get("sBatchPrefix").toString());
		searchConditionBean.setCouponName(item.get("sCouponName").toString());
		searchConditionBean.setValidStart((Date) item.get("dValidStart"));
		searchConditionBean.setValidEnd((Date) item.get("dValidEnd"));
		searchConditionBean.setCreateStart((Date) item.get("aAddTime"));
		searchConditionBean.setCreateEnd((Date) item.get("dExpiredDate"));

		getcouponbatchBean.setSearchCondition(searchConditionBean);
		getcouponbatchBean.setPageSize(1);
		getcouponbatchBean.setCurPage(1);

		return item;
	}

	/**
	 * 查询Ymt_CouponBatch表中最新一条记录，根据记录中的值设置请求bean
	 * 
	 * @return
	 */
	private Map setGetCouponBatchBean() {
		Logger.comment("查询Ymt_CouponBatch表中最新一条记录，根据记录中的值设置请求bean");

		Map item = new YmtCouponBatchWapper().getTop1CouponBatch().get(0);

		SearchConditionBean searchConditionBean = new SearchConditionBean();

		searchConditionBean.setSellerId(Integer.parseInt(item
				.get("iOperatorId").toString()));
		searchConditionBean.setBatchCode(item.get("sBatchCode").toString());
		searchConditionBean.setBatchPrefix(item.get("sBatchPrefix").toString());
		searchConditionBean.setCouponName(item.get("sCouponName").toString());
		searchConditionBean.setValidStart((Date) item.get("dValidStart"));
		searchConditionBean.setValidEnd((Date) item.get("dValidEnd"));
		searchConditionBean.setCreateStart((Date) item.get("aAddTime"));
		searchConditionBean.setCreateEnd((Date) item.get("dExpiredDate"));

		getcouponbatchBean.setSearchCondition(searchConditionBean);
		getcouponbatchBean.setPageSize(1);
		getcouponbatchBean.setCurPage(1);

		return item;
	}

	private void VerifyReturn(Map item) {
		Logger.verifyEquals("200", getcouponbatchCall.getCode(), "验证返回code");
		Logger.verifyEquals("0", getcouponbatchCall.getBCode(), "验证返回Bcode");
		Logger.verifyEquals("获取优惠券批次列表，总记录数1",
				getcouponbatchCall.getMessageText(), "验证返回MessageText");

		String batchCode = getcouponbatchBean.getSearchCondition()
				.getBatchCode();

		Logger.verifyEquals("1", getcouponbatchCall.getTotals(), "验证返回Totals");
		Logger.verifyEquals(item.get("sBatchCode").toString(),
				getcouponbatchCall.getBatchCode(),
				"验证返回BatchCode与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中sBatchCode字段相同");
		Logger.verifyEquals(item.get("sBatchPrefix").toString(),
				getcouponbatchCall.getBatchPrefix(),
				"验证返回BatchPrefix与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中sBatchPrefix字段相同");

		Logger.verifyEquals(item.get("iOperatorId").toString(),
				getcouponbatchCall.getSellerId(),
				"验证返回SellerId与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中iOperatorId字段相同");
		Logger.verifyEquals(item.get("sCouponName").toString(),
				getcouponbatchCall.getCouponName(),
				"验证返回CouponName与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中sCouponName字段相同");
		Logger.verifyEquals(item.get("sApplyMemo").toString(),
				getcouponbatchCall.getCouponDesc(),
				"验证返回CouponDesc与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中sApplyMemo字段相同");

		String fCouponValue = item.get("fCouponValue").toString()
				.replaceAll("[.]$", "");
		Logger.verifyEquals(
				fCouponValue.substring(0, fCouponValue.length() - 3),
				getcouponbatchCall.getCouponValue(),
				"验证返回CouponValue与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中fCouponValue字段相同");

		String fMinOrderValue = item.get("fMinOrderValue").toString();
		Logger.verifyEquals(
				fMinOrderValue.substring(0, fMinOrderValue.length() - 3),
				getcouponbatchCall.getOrderValue(),
				"验证返回OrderValue与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中fMinOrderValue字段相同");

		String iMaxUseTime = item.get("iMaxUseTime").toString();
		Logger.verifyEquals(iMaxUseTime, getcouponbatchCall.getMaxSendNum(),
				"验证返回MaxSendNum与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中iMaxUseTime字段相同");

		String iMaxUseTimePerUser = item.get("iMaxUseTimePerUser").toString();
		Logger.verifyEquals(iMaxUseTimePerUser,
				getcouponbatchCall.getUserMaxReceiveNum(),
				"验证返回UserMaxReceiveNum与数据库中表Ymt_CouponBatch中sBatchCode="
						+ batchCode + "记录中iMaxUseTimePerUser字段相同");

		// "CreateStart":"0001-01-01T00:00:00","CreateEnd":"0001-01-01T00:00:00"不知道取得哪的
		// "HaveSendNum":0,"HaveUsedNum":0 未验证
		// "InvalidTime":null,"InvalidStatus":false未验证

		Logger.verifyEquals(
				item.containsKey("dInvalidTime") ? item.get("dInvalidTime")
						.toString() : "null", getcouponbatchCall
						.getInvalidTime(),
				"验证返回InvalidTime与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中dInvalidTime字段相同");
		Logger.verifyEquals(item.get("bInvalidStatus").toString(),
				getcouponbatchCall.getInvalidStatus(),
				"验证返回InvalidStatus与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中bInvalidStatus字段相同");

		Logger.verifyEquals(
				item.containsKey("sUsePlatforms") ? item.get("sUsePlatforms")
						.toString() : "null", getcouponbatchCall
						.getUsePlatforms(),
				"验证返回UsePlatforms与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中sUsePlatforms字段相同");
		Logger.verifyEquals(item.get("iScenarioType").toString(),
				getcouponbatchCall.getScenarioType(),
				"验证返回ScenarioType与数据库中表Ymt_CouponBatch中sBatchCode=" + batchCode
						+ "记录中iScenarioType字段相同");

		// "ProductCodes":null不知道取得哪的

	}
}